MDS, Hermitian almost MDS, and Gilbert–Varshamov quantum codes from generalized monomial-Cartesian codes

We construct new stabilizer quantum error-correcting codes from generalized monomial-Cartesian codes. Our construction uses an explicitly defined twist vector, and we present formulas for the minimum distance and dimension. Generalized monomial-Cartesian codes arise from polynomials in m variables. When \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$m=1$$\end{document}m=1 our codes are MDS, and when \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$m=2$$\end{document}m=2 and our lower bound for the minimum distance is 3, the codes are at least Hermitian almost MDS. For an infinite family of parameters, when \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$m=2$$\end{document}m=2 we prove that our codes beat the Gilbert–Varshamov bound. We also present many examples of our codes that are better than any known code in the literature.


Introduction
Certain classically intractable problems can become feasible when approached with the computational power of quantum computers.This was demonstrated through Shor's algorithm, which solves in polynomial time the prime factorization problem and discrete logarithm problem on quantum computers [50].Due to this fact, researchers and companies are actively engaged in constructing quantum computers with many qubits [10,15].Quantum computer implementations have higher error rates than classical computers, making reliability a challenge.However, despite quantum information being unclonable [18,56], it was shown that quantum error correction techniques can be used [49,53].Over the last twenty-five years, error correction has proved to be one of the main obstacles to scaling up quantum computing and quantum information processing.
There is an extensive study of quantum error-correcting codes, see for example the papers [3,4,11,12,31,33,52] for the binary case and [5,6,9,14,21,24,27,32,35,40,41,47,51] for the general case.Many of the known quantum error-correcting codes are stabilizer codes.Let C be the complex field, let q be a prime power and let n be a positive integer.A stabilizer code Q = {0} is the common eigenspace of an abelian subgroup of the error group G n generated by a nice error basis on the space C q n (see [36,37] for details).The code Q has minimum distance d whenever all errors in G n with weight less than d can be detected, or have no effect on Q, but some errors of weight d cannot be detected.A code as above has parameters [[n, k, d]] q when it is a q k -dimensional subspace of C q n and has minimum distance d (see, for instance, [12,35]).Stabilizer quantum error-correcting codes have been studied by many authors because they can be constructed from classical additive codes in F 2n q , which are selforthogonal with respect to a trace symplectic form.In particular, stabilizer codes can be obtained from suitable Hermitian self-orthogonal classical linear codes (see [35] or [5,9,12] for details).We will utilize this construction.
Many constructions of classical codes start with a quotient polynomial ring of the form F q [X 1 , . . ., X m ]/I where I is an ideal.Affine variety codes were introduced by Fitzgerald and Lax in [23], with a general ideal I .Our codes C v, ,Z (defined in the next section) are a type of generalized affine variety code, so we could use this name.However, since the codes we define are generalized monomial-Cartesian codes, introduced in [45], and although the definition is slightly different, we are going to call our codes C v, ,Z generalized monomial-Cartesian codes.
Monomial-Cartesian codes (MCCs) are a class of evaluation codes obtained as the image of maps ev S : V ⊂ F q [X 1 , . . ., X m ]/I −→ F n q , ev S ( f where m is a positive integer larger than 1, S = S 1 × • • • × S m = {β 1 , . . ., β n } is a Cartesian-product subset of F m q , I is the vanishing ideal at S of F q [X 1 , . . ., X m ], and V is an F q -linear space generated by classes of monomials.MCCs were introduced in [45] with only algebraic tools, see also [46].These codes have several different applications in the literature, such as quantum codes, locally recoverable codes (LRCs) with availability, polar codes and (r , δ)-LRCs [13,26,45].
Generalized monomial-Cartesian codes arise when changing the evaluation map ev S to twist each coordinate of ev S ( f ) by nonzero elements of F q .In this article, we will use generalized MCCs, where the set S 1 is a certain fixed set, and we will use the same name for this construction, see Definition 2.3.We will use generalized monomial-Cartesian codes to construct Hermitian self-orthogonal classical linear codes and thereby construct stabilizer quantum codes.We present some evidence comparing our codes to codes in [8,14,16,28,38,43,55], which shows that they are very good quantum codes, and sometimes optimal.
Quantum MDS codes are those achieving the quantum singleton bound; there are many papers on this type of codes.(Some recent papers are [7,19,42].)The MDS conjecture limits the length of a q-ary quantum MDS code to be at most q 2 + 2 [35].Thus, another goal is to obtain longer q-ary codes with good parameters.With our construction, we achieve this.
The paper is laid out as follows: After the preliminaries in Sect.2, we present our construction in Sect.3. Previous works using a twist vector have proved the existence of a twist vector with the required properties, whereas a feature of our construction is that we define the twist vector explicitly, see (3) in Sect.3. We present a general construction first (Theorem 3.4) and then a more specific construction that allows us to control the minimum distance (Theorem 3.7).In Sect.4, we will show that our construction with m = 1 gives MDS codes.We also prove that when m = 2 and our lower bound for the minimum distance is 3 the codes are at least Hermitian almost MDS.Section 5 contains a proof that for an infinite family of parameters when m = 2, our codes beat the Gilbert-Varshamov bound.Finally, in Sect.6 we present some examples with small parameters that beat the best known codes in the literature.

Preliminaries
In this paper, we will assume that q is odd, although in this section the definitions hold for any q.Let us denote by N the set of positive integers and by N 0 the set of nonnegative integers.For any two vectors a = (a 0 , . . ., their Hermitian inner product is defined as: their Euclidean inner product is defined as: and their * product is defined as: Let the symbol ⊥ h (respectively, ⊥ e ) mean dual with respect to Hermitian (respectively, Euclidean) inner product.For a vector subspace (or code) C of F n q 2 , we let C ⊥ h (respectively, C ⊥ e ) denote the orthogonal vector subspace (the dual code) with respect to the Hermitian (respectively, Euclidean) inner product.We denote by d(C) the minimum distance of C. Let s be a nonnegative integer and c = (c 0 , . . ., c n−1 ) ∈ C be a codeword.We denote c s = (c s 0 , . . ., c s n−1 ) and Let us denote by w(c) the Hamming weight of c.We say that two codes are isometric if there exists a bijective mapping between them that preserves Hamming weights.The idea in this paper is to construct codes that satisfy the hypotheses of Theorem 2.1.In order to do so, we fix a finite field F q 2 .Let F q 2 [X 1 , . . ., X m ] be the polynomial ring in m ≥ 1 variables over F q 2 .For each element e = (e 1 , . . ., e m ) ∈ N m 0 , we write X e for X e 1  1 X e 2 2 • • • X e m m .We will refer to e as an exponent and use the lexicographic order in N m 0 for the exponents.That is, given e, e ∈ N m 0 , we say e < e if and only if e 1 < e 1 or there exists j ∈ {2, . . ., m} such that e 1 = e 1 , . . ., e j−1 = e j−1 and e j < e j .Any order can be used.
Let λ ∈ N such that λ | q − 1.Let A 1 be the set of roots of the polynomial X λ(q+1) 1 − 1, which lie in F q 2 .We also consider arbitrary subsets A j ⊆ F * q 2 for j = 2, . . ., m which have cardinality greater than or equal to 2. Let a j := # A j for j = 1, . . ., m, so that a 1 = λ(q + 1).Let be the monic polynomial in one variable whose roots are the elements of A j , then deg(Q j ) = a j for j = 1, . . ., m.Let I be the ideal of and let Given f ∈ R, in this paper f is going to denote both the equivalence class in R and the unique polynomial representing f in F q 2 [X 1 , . . ., X m ] with degree in X j less than a j , 1 ≤ j ≤ m.Thus, one can write any f ∈ R uniquely as Note that V is the F q 2 -vector space consisting of the F q 2 -span of {X e | e ∈ }.
For any positive integer t, we denote by ζ t a primitive t-th root of unity.Since A j has a j elements, we choose a bijection between A j and the set {0, 1, . . ., a j − 1}, and this is going to give us an ordering of A j , j = 2, . . ., m.Let us represent by ξ ( j,s) the elements of each set A j , where the subindex s ∈ {0, 1, . . ., a j − 1} is given by the ordering.For α = (α 1 , . . ., α m ) ∈ E, we define P α ∈ Z by where α 1 indicates the exponent of ζ λ(q+1) and α j ∈ {0, 1, . . ., a j − 1} gives the position of the element ξ ( j,α j ) ∈ A j in the ordering of A j , j = 2, . . ., m.Every element of Z has the form P α for some α ∈ E. This sets up a bijection between Z and E.
) n , we will refer to this vector as the twist vector.We index the coordinates of v by the elements of E, and we order the coordinates of v in the same way as we ordered the elements of Z .That is, The linear evaluation map in Z : is injective by the definition of R. It provides the following class of evaluation codes.

Definition 2.3
Let V be as defined in Definition 2.2.The generalized monomial-Cartesian code (GMCC) C v, ,Z is the image of V via the evaluation map ev v,Z , that is, Since the order of the set Z will be fixed for the rest of the article, we will use the notation ev v := ev v,Z and C v, := C v, ,Z .

Remark 2.4
Evaluation maps of our codes are defined on subsets of coordinate rings of certain affine varieties, but these codes can also be introduced with algebraic tools.Monomial-Cartesian codes were introduced in [45] using only algebraic tools.When the set A 1 ⊆ F q 2 is arbitrary, GMCCs extend monomial-Cartesian codes.This should be the accurate definition, but for our purposes in this paper we use this particular set A 1 , namely the λ(q + 1)-th roots of unity.
Here is a standard fact, that the dual of a GMCC is another GMCC.

Lemma 2.5
The dual code (C v, ) ⊥ h is a GMCC C w, for some twist vector w.

Proof Consider any two codewords
Then, the following equation holds: is a bijective mapping.We use this presentation of C v, .

First we claim that for any
for all i, and using (2).This shows that all the vectors w * b are in Finally note that The length and the dimension of a GMCC are n and # , respectively.A bound for the minimum distance is provided in Corollary 2.8.

Lemma 2.6
The GMCCs C 1, and C v, are isometric.
has the same Hamming weight, this is because v i = 0 for all i = 1, . . ., n.
Fig. 1 In the case m = 2, we can use a grid to represent the set E so that an exponent e = (e 1 , e 2 ) ∈ E corresponds to the point with coordinates (e 1 , e 2 ) in the grid and that point is labelled with the integer D(e).Exponents in the set ⊆ E are coloured in blue.This example shows the grid representation of E, where a 1 = 8, a 2 = 6, and = ({0, 1, 2} × {0, 1}) ∪ {(0, 2), (1, 2)}.In this example, the lower bound for the minimum distance of the code Affine variety codes admit a bound on the minimum distance, known as the footprint bound [29].Monomial-Cartesian codes C 1, in the sense of our Definition 2.3 (the evaluation map is defined over the coordinate ring of some affine variety) are affine variety codes.This fact and Lemma 2.6 prove the next lemma, stating that this bound is also valid for GMCCs.For every exponent e ∈ E, we define D(e) := m j=1 (a j − e j ).

Lemma 2.7 Let C v, be a GMCC and let
Fix a monomial ordering on (N 0 ) m and let X e be the leading monomial of f .Then, w(c) ≥ D(e).Remark 2.9 Affine variety codes were introduced in [23] for any ideal I .A classical result coming from the theory of Gröbner basis [17] implies that d ≥ d 0 , where d stands for the minimum distance of an affine variety code and d 0 is the cited footprint bound [29].Independently, inspired by the algebraic geometric codes [34] the socalled Feng-Rao bound for the minimum distance of the dual code is derived [20].It is known that every linear code is an algebraic geometric code.A similar bound (Andersen-Geil) was also given for an algebraic geometric code [2].It turns out that for monomial-Cartesian codes the footprint bound applied to the dual code and the Feng-Rao bound coincide [25].Although the footprint bound is more natural for the primal code, and the Feng-Rao bound is more natural for the dual code, we will always refer to them as d 0 .
Lemma 2.10 Let C v, be a GMCC.Then, (C v, ) ⊥ h and (C v, ) ⊥ e are isometric.
Proof It follows from the fact that the family of GMCCs is closed under duality by Lemma 2.5 and by Lemma 2.6.

Stabilizer quantum codes from generalized monomial-Cartesian codes
In the present section, we construct stabilizer quantum codes by applying Theorem 2.1 to GMCCs (Definition 2.3) with a specific twist vector.Recall from Sect. 2 that q is an odd prime power, We are going to choose the twist vector defined explicitly as follows: ).
Observe that there are q + 1 blocks of −1's or 1's.Recall that the coordinates v α of v are labelled and ordered in the same way as the points P α ∈ Z .This twist vector works as follows.For each α ∈ E, Notice that v α only depends on α 1 .The reason why we choose this specific twist vector is going to become clear in Proposition 3.1.

Self-orthogonality conditions
First we present some conditions for the evaluation vectors of monomials in R to be orthogonal for the Hermitian inner product, when our twist vector is used.
Proposition 3.1 Keep the same notations as before.Let q be an odd prime power and consider the twist vector v defined in (3).Let e = (e 1 , . . ., e m ), e = (e 1 , . . ., e m ) ∈ E be exponents of two monomials X e , X e ∈ R.Then, the evaluation vectors under the map ev v of these monomials are orthogonal for the Hermitian inner product if one of the following conditions hold: • e 1 ≡ e 1 mod q + 1, or • e 1 ≡ e 1 mod q+1 2 .Proof In order to compute some conditions under which two evaluations of monomials of the quotient ring R are orthogonal for the Hermitian inner product, we have to see when the following sum vanishes: Since v α only depends on α 1 , we can denote by v α 1 := v (α 1 ,...,α m ) = v α and reorder the above sum in the following way: We can do that because all the coordinates v α in v that have the same α 1 have the same value.Now we study when the first factor equals 0, and we will ignore the other factors, since the first one gives enough information for the proof.Consider then which is a sum over α 1 ∈ {0, 1, . . ., λ(q + 1) − 1}.We write each α 1 in the form kλ + r where 0 ≤ k ≤ q and 0 ≤ r < λ.Using this to break (5) into λ blocks of size q + 1, using the fact that ζ q+1 := ζ λ λ(q+1) is a primitive q + 1-th root of unity and using the structure of the twist vector v, we can write (5) as k(e 1 +qe 1 ) q+1 .
Notice that we can do that because from (4) and the fact that 1 ≤ λ ≤ q − 1 we have that v for all 0 ≤ k ≤ q.Now using again (4) and the fact that ζ q+1 q+1 is a primitive q+1 2 -th root of unity, we rewrite the last sum in the following way: 2k(e 1 +qe 1 ) q+1 Thus, we have shown that we can write (5) as The above product equals 0 if and only if one of the following conditions holds: • ζ e 1 +qe 1 q+1 − 1 = 0 ⇐⇒ e 1 + qe 1 ≡ 0 mod q + 1.That is, e 1 ≡ e 1 mod q + 1; or  q+1) is a λ-th root of unity other than 1.That is equivalent to e 1 + qe 1 ≡ 0 mod q + 1 and e 1 + qe 1 ≡ 0 mod λ(q + 1), which is a particular case of the first condition.
Therefore, if either of the first two conditions hold, the sum (5) equals 0 and that implies that ev v (X e ) and ev v (X e ) are orthogonal for the Hermitian inner product.Remark 3.2 Consider the case when the twist vector is 1, λ = 1 and A j is the set of q + 1-th roots of unity, that is the solutions to X q+1 j − 1 = 0, for every j = 1, . . ., m.Then for any ⊆ E the GMCC C 1, is an Affine Variety Code (AVC) and it is not self-orthogonal (for the Hermitian inner product).This is because when we compute the Hermitian inner product of the evaluations of any monomial X e = X (e 1 ,...,e m ) with itself, one obtains that and every factor above is Thus, the evaluation of a monomial is not orthogonal to itself, and these codes are not self-orthogonal.However, we are able to provide a twist vector v (3) to construct a self-orthogonal GMCC C v, which is isometric to the non-self-orthogonal AVC C 1, .The problem of not getting evaluations of monomials to be self-orthogonal can happen also with other twist vectors, that is why one has to choose the twist vector carefully.

Our general construction
Before stating the theorem that is the general construction of this paper, recall the definition of the set E in the previous section.We define a subset in E which will be useful in the following.

Definition 3.3 Let E
The next theorem shows that the set E 0 introduced in Definition 3.3 is used as a reference to construct Hermitian self-orthogonal GMCCs., where m = 2, a 1 = 8 and a 2 = 6.We use the same conventions as in Fig. 1 Theorem 3.4 Let q be an odd prime power and let m ≥ 1, λ | q − 1, a 1 := λ(q + 1) and 2 ≤ a j ≤ q 2 − 1, j = 2, . . ., m be positive integers.Let n := a 1 • • • a m .Consider the twist vector v defined in (3) and the set E 0 ⊆ E introduced in Definition 3.3.Let be a subset of E 0 .Then, Therefore, there exists a stabilizer quantum code with parameters Proof Since for all (e 1 , . . ., e m ) ∈ we have e 1 ≤ q−1 2 , the self-orthogonality follows from Proposition 3.1.The existence and parameters of the stabilizer quantum code follow from Theorem 2.1.Notice that d = d((C v, ) ⊥ h ), but from Corollary 2.12 we can conclude that d = d((C 1, ) ⊥ e ).
Notice that in the above theorem we do not give an explicit bound for the minimum distance, but it can be computed using Corollary 2.8 in every particular case.

Our specific construction
Now we are going to provide a strategy [30] to choose a set ⊆ E 0 so that we can control the minimum distance d((C 1, ) ⊥ e ) and it maximizes the dimension of the resulting stabilizer quantum code.To that purpose, we need the following Definition 3.5 Let 2 ≤ t ≤ q+3 2 be a positive integer.Define Some instances of the above set are represented in Fig. 2.
Lemma 3.6 Let t ⊆ E be the set introduced in Definition 3.5.Then, Proof Using the notations in [25, Section 3], the authors define a code C(L 2 ), where By choosing their (s 1 , . . ., s m ) and δ ⊥ equal to our (a 1 , . . ., a m ) and t, respectively, then we have that [25,Definition 15].The statement follows from their equation ( 8) in Section 3.
Theorem 3.7 Let q be an odd prime power and let m ≥ 1, λ | q − 1, a 1 := λ(q + 1) and 2 ≤ a j ≤ q 2 − 1, j = 2, . . ., m be positive integers.Let n := a 1 • • • a m .Consider the twist vector v defined in (3), a positive integer and the set t ⊆ E introduced in Definition 3.5.Then, the following inclusion holds Therefore, there exists a stabilizer quantum code with parameters Proof Let e ∈ t .From m j=1 (e j + 1) < t, we have that e 2 and therefore t ⊆ E 0 .So, from Theorem 3.4 we have that The existence and parameters of the stabilizer quantum code follows from Theorem 2.1.Notice that from Corollary 2.12 and Lemma 3.6, we have d

The dimension
We state a recursive formula for the dimension of the quantum code, which is shown in [30].
Let a, b ∈ N. Consider the case when a j = b for all j = 1, . . ., m.We define In [30], they give the following recursive formula: , where all of a 1 , . . ., a m are equal to λ(q +1).Therefore, we can use the recursive formula described above to compute # t , and hence the dimension of the quantum code in Theorem 3.7.For example, when m = 2 ) and when m = 3

We obtain MDS and Hermitian almost MDS quantum codes
In this section, we prove that we can obtain quantum codes that are close to the singleton bound.Let us recall first the quantum singleton bound.
Lemma 4.1 (Quantum Singleton bound [48]) If a stabilizer quantum code with parameters Codes attaining equality are called quantum MDS codes.

Theorem 4.2
The stabilizer quantum codes obtained from Theorem 3.7 with m = 1 are quantum MDS codes.
The article [54] recently appeared on the arxiv and has a construction of MDS codes with lengths of the form r (q 2 − 1)/h where h is an even divisor of q − 1 and r ≤ h/2 (their Theorems 3, 4 and 5).This article does not provide an explicit twist vector (they prove the existence of it).Our construction has an explicit twist vector and (in the m = 1 case) gives codes with the same parameters.

Hermitian almost MDS
The quantum singleton defect of a parameter set n, k, d is defined to be n−(k +2d −2).MDS codes have quantum singleton defect 0, by definition.Codes with quantum Singleton defect 1 are called quantum almost MDS (QAMDS) codes.However, from the statement of Theorem 2.1, one can see that the quantum singleton defect of any code constructed using Theorem 2.1 must be even, and thus, a quantum singleton defect of 1 cannot be achieved.The smallest nonzero singleton defect of a code constructed using Theorem 2.1 is therefore 2. This motivates the following definition.In Theorem 4.2, we showed that we can construct quantum MDS codes.Recall that the quantum MDS conjecture [35] states that n ≤ q 2 + 1 for a quantum MDS code with parameters [[n, k, d]] q and q odd.Now we are going to show that we can also construct quantum codes with n > q 2 + 1 that are at least QHAMDS.That is, they are either QHAMDS or MDS.If the quantum MDS conjecture is true, they cannot be MDS, and therefore they would have the best possible parameters.Theorem 4. 4 The stabilizer quantum codes obtained from Theorem 3.7 with m = 2, n > q 2 + 1 and t = 3 are at least QHAMDS.
Proof Let m = 2, t = 3 and λ and a 2 be as defined in Theorem 3.7 such that n > q 2 + 1.We have 3 = {(0, 0), (1, 0), (0, 1)} (see Fig. 2).The parameters of the stabilizer quantum code constructed from Theorem 3.7 are It is easily verified that the above parameters provide a code which is at least QHAMDS.This is because k + 2d ≥ λ(q + 1)a 2 − 6 + 2 • 3 = λ(q + 1)a 2 = n.Some examples will be given in Tables 3 to 7. In [16], the authors study ternary quantum codes of minimum distance three.In that paper (their Theorem 4.4), quantum codes with parameters [[n, n−7, 3]] 3 are shown for certain lengths n.For those lengths which are a multiple of 4 and less than 64, we can improve the dimension by 1, using the codes in Theorem 4.4.See also Table 3.

When m = 2 we can beat Gilbert-Varshamov bound
In this section, we include a proof that an infinite family of codes obtained from our constructions will beat the quantum Gilbert-Varshamov bound when m = 2.We remark that the codes with m > 2 can also beat the Gilbert-Varshamov bound, some examples when m = 3 are presented in Tables 3, 4 and 6.
Let us recall the quantum Gilbert-Varshamov bound whose proof can be found in [22]: then there exists a pure stabilizer quantum code with parameters [[n, k, d]] q .
We say that a parameter set n, k, d, q beats the QGV bound if the inequality ( 7) is not satisfied.
In the m = 2 case, we have the following statement, using the codes constructed in this paper.In this statement, we are using the formula (6).Theorem 5.2 Given an odd prime power q, and given d in the range 5 ≤ d ≤ (q+3)/2, let n be in the interval and have the form λ(q + 1)a 2 where λ | (q − 1) and 2 ≤ a 2 ≤ q 2 − 1.Then, there exists a quantum code with parameters and this code beats the quantum Gilbert-Varshamov bound.
Proof.We use the codes whose existence is proved in Theorem 3.7 in the case m = 2.The upper bounds d ≤ (q + 3)/2 and n ≤ (q 2 − 1) 2 follow from the construction in Theorem 3.7.

Let
(this dimension formula comes from ( 6) which uses our construction with m = 2).We wish to prove that A > D under the stated hypotheses.To prove this, we are going to let and we will prove three things: that A > B, that B ≥ C, and that C > D. This will complete the proof that A > D.
To show that A > B, we will use the estimate for binomial coefficients n k > ( n k ) k .Then To prove that B ≥ C, rearranging the hypothesis q 2 (q 2 − 1) d−1 q 2(d−1)(0.7+ln(d−1))To prove that C > D, we will use the fact that if r ≥ 4 then H r < 0.7 + ln r where H r is the r -th harmonic number defined by H r = r j=1 It follows that In this theorem, we assumed that d ≥ 5 because of the constant 0.7, which is a choice.The cases d = 3 and d = 4 can be proved separately.They could be included in the proof above but the constant 0.7 would have to be larger.Similarly, we could have stated the theorem for d ≥ 6 and the constant would be smaller, it would be 0.68.Then, the d = 5 case would need to be handled separately.As d gets larger, the constant gets smaller and approaches the Euler-Mascheroni constant.
We show Table 1 where for each q between 7 and 17 and d = 5, 6, 7 we give the range of values of n for which the quantum Gilbert-Varshamov bound is beaten, as given by Theorem 5.2.
A separate special analysis for each d, or using better estimates in the proof, or using a computer, will give a better range of values for n than the statement of Theorem 5.2.
For example, when q = 7 and d = 5, computer calculations show that the Varshamov bound is beaten by our codes as soon as n > 295, whereas the proof of Theorem 5.2 gives n ≥ 742.As another example, when q = 11 and d = 7, the range of values of n as given by the statement of Theorem 5.2 is empty (in the table we wrote 'none').However, there are in fact values of n that beat the Gilbert-Varshamov bound.We state one example [[7200, 7172, 7]] 11 in Table 7.
We also remark that Theorem 5.2 is for m = 2.A similar result will hold for m > 2.

d = 3
In the previous theorem, we assumed that d ≥ 5 to obtain a slightly stronger statement.We will treat the case that d = 3 (and m = 2) separately, and we will complete the analysis in detail now.We omit the d = 4 case, which is similar.Suppose d = 3.By the formula (6) we have that 3 has 3 elements, see also Fig. 2. The two sides of the Gilbert-Varshamov bound become To beat the G-V bound, we obtain a condition which is a quadratic polynomial in n, namely we require that n + n 2 (q 2 − 1) − (q 6 + q 4 + q 2 + 1) > 0.
Solving the quadratic yields that the G-V bound is beaten when For m = 2 the largest possible n is (q − 1)(q + 1)(q 2 − 1).Therefore, for each valid n which is a multiple of q + 1 between and (q 2 − 1) 2 we obtain a code of that length that beats the G-V bound.
We show Table 2 where for each q and d = 3 we state the range of values of n for which Gilbert-Varshamov bound is beaten.
In the d = 4 case (details omitted), the polynomial in n would be cubic instead of quadratic.Finally, the article [54] recently appeared on the arxiv and has a construction of MDS codes with lengths of the form r (q 2 − 1)/h where h is an even divisor of q − 1 and r ≤ h/2 (their Theorems 3, 4 and 5).Some of the MDS codes appearing in our tables may also be obtained with their construction.

Definition 4 . 3 A
quantum code constructed from Theorem 2.1 with parameters [[n, k, d]] q such that n = k + 2d is called a quantum Hermitian almost MDS (QHAMDS) code.
Theorem 2.1([1, 35]) Let C be a linear[n, k, d]error-correcting code over the field F q 2 such that C ⊆ C ⊥ h .Then, there exists an [[n, n −2k, ≥ d ⊥ h ]] q stabilizer quantum code, where d ⊥ h stands for the minimum distance of C ⊥ h .

Table 1
Some instances of the range of lengths of codes (from 5.2 only) that beat the quantum Gilbert-Varshamov bound

Table 2
Some instances of the range of lengths of codes from Theorem 3.7 with d = 3 that beat the quantum Gilbert-Varshamov bound

Table 4 A
q = 5 sample of codes

Table 5
A q = 7 sample of codes

Table 6 A
q = 9 sample of codes